﻿@{
    ViewBag.Title = "HouseCollect";
    Layout = "~/Views/Shared/Template.cshtml";
}
<link href="~/static/collect.css" rel="stylesheet" />
<link href="~/static/myhome.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.8.2.min.js"></script>

@using Partner.MVC.Models;
@{
    var user = Session["LoginUser"] as User_Info;
}

<style>
    #divLeft {
        width: 24%;
    }

    #divContent {
        width: 75%;
    }
</style>

<div style="height: 300px;width: 100%;background:url(/static/hbweb/images/me.jpg);">
    <div class="container">
        <div class="header-message">
            <img class="fl" src="http://pic.huobanchina.com/o_1bp7omfg8e821pc4bbg1u8g1ifl9.jpeg" alt="" />
            <div class="fl header-text">
                <h3 class="user-name">@user.Use_Name </h3>
                <i class="icon-fabu3 point user-namei"></i>
            </div>
            <a id="AlterPwd" style="width:85px;" data-toggle="modal" data-target="#myModal" class="fr fn-font-hover-blue change change-password">
                修改密码
            </a>
        </div>
    </div>
</div>

<div class="bgcSil">
    <div class="container">
        <div class="mt30" style="width: 100%">
            <ul id="divLeft" class="nav navbar-nav"></ul>
            <div id="divContent" class="fr mb80 cont">
                <div class="news-title-tab clearfix">
                    <ul id="myTab" class="nav nav-tabs">
                        <li class="active"><a href="#home" data-toggle="tab">全部</a></li>
                        <li><a href="#country" data-toggle="tab">伙办办公</a></li>
                        <li><a href="#jmeter" data-toggle="tab">伙办公寓</a></li>
                        <li><a href="#ejb" data-toggle="tab">伙办商铺</a></li>
                    </ul>
                    <div onclick="delall()" class="dleact">
                        <i class="icon-delect"></i>
                        <a>删除</a>
                    </div>
                </div>
                <div class="news-list-con bgcWhit">
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane fade in active" id="home">
                            <div class="news-list-info clearfix">
                                <ul>
                                    @foreach (var a in ViewBag.House)
                                    {
                                        <li class="prs">
                                            <a class="fl" href="/HouseMessage/HouseMessage?House_Id=@a.House_Id" target="_blank">
                                                <img src="~/images/fangjian.jpg" alt="投融界2017每日融资报告（1.12）" />
                                            </a>
                                            <input type="checkbox" name="checked" class="chckb" value="@a.House_Id" />
                                            <div class="news-note pr">
                                                <div class="rmb">
                                                    <p><span style="color: red;font-size: 30px">3.0</span>千元/月</p>
                                                    <p style="color:#979797 "><i class="icon-heart3"></i>收藏</p>
                                                </div>
                                                <h3>
                                                    <a class="fcBlack" href="/HouseMessage/HouseMessage?House_Id=@a.House_Id" target="_blank" title="伟峰国际商务中心">@a.House_Name-@a.House_Telphone</a>
                                                </h3>
                                                <p class="p"><span>可用面积</span>&nbsp;&nbsp;&nbsp;<span>@a.House_Area  m2 | </span></p>
                                                <p>地址 ： @a.House_Address</p>
                                                <br />
                                            </div>
                                        </li>
                                    }
                                </ul>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="country">
                            <div class="news-list-info clearfix">
                                <ul>
                                    @foreach (var a in ViewBag.HouseWork)
                                    {
                                        <li class="pr">
                                            <a class="fl" href="/HouseMessage/HouseMessage?House_Id=@a.House_Id" target="_blank">
                                                <img src="~/images/fangjian.jpg" alt="投融界2017每日融资报告（1.12）" />
                                            </a>
                                            <input type="checkbox" class="chckb" value="@a.House_Id" />
                                            <div class="news-note pr">
                                                <div class="rmb">
                                                    <p><span style="color: red;font-size: 30px">3.0</span>千元/月</p>
                                                    <p style="color:#979797 "><i class="icon-heart3"></i>收藏</p>
                                                </div>
                                                <h3>
                                                    <a class="fcBlack" href="/HouseMessage/HouseMessage?House_Id=@a.House_Id" target="_blank" title="伟峰国际商务中心">@a.House_Name-@a.House_Telphone</a>
                                                </h3>
                                                <p class="p"><span>可用面积</span>&nbsp;&nbsp;&nbsp;<span>@a.House_Area  m2 | </span></p>
                                                <p>地址 ： @a.House_Address</p>
                                                <br />
                                            </div>
                                        </li>
                                    }
                                </ul>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="jmeter">
                            <div class="news-list-info clearfix">
                                <ul>
                                    @foreach (var a in ViewBag.HouseApment)
                                    {
                                        <li class="pr">
                                            <a class="fl" href="/HouseMessage/HouseMessage?House_Id=@a.House_Id" target="_blank">
                                                <img src="~/images/fangjian.jpg" alt="投融界2017每日融资报告（1.12）" />
                                            </a>
                                            <input type="checkbox" class="chckb" value="@a.House_Id" />
                                            <div class="news-note pr">
                                                <div class="rmb">
                                                    <p><span style="color: red;font-size: 30px">3.0</span>千元/月</p>
                                                    <p style="color:#979797 "><i class="icon-heart3"></i>收藏</p>
                                                </div>
                                                <h3>
                                                    <a class="fcBlack" href="/HouseMessage/HouseMessage?House_Id=@a.House_Id" target="_blank" title="伟峰国际商务中心">@a.House_Name-@a.House_Telphone</a>
                                                </h3>
                                                <p class="p"><span>可用面积</span>&nbsp;&nbsp;&nbsp;<span>@a.House_Area  m2 | </span></p>
                                                <p>地址 ： @a.House_Address</p>
                                                <br />
                                            </div>
                                        </li>
                                    }
                                </ul>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="ejb">
                            <div class="news-list-info clearfix">
                                <ul>
                                    @foreach (var a in ViewBag.HouseShop)
                                    {
                                        <li class="pr">
                                            <a class="fl" href="/HouseMessage/HouseMessage?House_Id=@a.House_Id" target="_blank">
                                                <img src="~/images/fangjian.jpg" alt="投融界2017每日融资报告（1.12）" />
                                            </a>
                                            <input type="checkbox" class="chckb" value="@a.House_Id" />
                                            <div class="news-note pr">
                                                <div class="rmb">
                                                    <p><span style="color: red;font-size: 30px">3.0</span>千元/月</p>
                                                    <p style="color:#979797 "><i class="icon-heart3"></i>收藏</p>
                                                </div>
                                                <h3>
                                                    <a class="fcBlack" href="/HouseMessage/HouseMessage?House_Id=@a.House_Id" target="_blank" title="伟峰国际商务中心">@a.House_Name-@a.House_Telphone</a>
                                                </h3>
                                                <p class="p"><span>可用面积</span>&nbsp;&nbsp;&nbsp;<span>@a.House_Area  m2 | </span></p>
                                                <p>地址 ： @a.House_Address</p>
                                                <br />
                                            </div>
                                        </li>
                                    }
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    ParentNav();
    绑定根节点
    function ParentNav() {
        $.ajax({
            type: "post",
            url: "/Partner/LeftNav",
            dataType: "json",
            success: function (data) {
                var htmltab = "";
                for (var i = 0; i < data.length; i++) {
                    htmltab += "<li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" style=\"width: 175px;font-size: 16px;\">" + data[i].Lar_Name + "</a>" + SonNav(data[i].Limit_Id) + "</li>";
                }
                $("#divLeft").append(htmltab);
            },
            error: function (err) {
                alert(err);
            }
        })
    }
    // 绑定子节点
    function SonNav(id) {
        var html1 = "";
        $.ajax({
            type: "post",
            url: "/Partner/LeftSon",
            data: { pid: id },
            dataType: "json",
            async: false,
            success: function (data) {
                var strhtml = "<ul class=\"dropdown-menu\">"
                for (var i = 0; i < data.length; i++) {
                    strhtml += "<li><a href=\"" + data[i].Limit_Url + "\">" + data[i].Limit_Name + "</a></li>"
                }
                strhtml += "</ul>";
                html1 = strhtml;
            }
        })
        return html1;
    }
    //批量删除
    function delall() {
        var id = "";
        for (var i = 0; i < $('.chckb').length; i++) {               //循环查找复选框
            if ($('.chckb').eq(i).attr("checked") == "checked") {    //判断每行复选框的状态
                id += $('.chckb').eq(i).val() + ",";                 //获取选中行的id
            }
        }
        id = id.substr(0, id.length - 1);
        if (id.length == 0) {
            alert("请选择要删除的信息!");
        }
        else
            if (confirm('确定要删除吗？')) {
                $.ajax({
                    type: "post",
                    url: "/UserCenter/Delete",
                    data: { House_Id: id },
                    success: function (obj) {
                        if (obj > 0) {
                            location.href = '/usercenter/housecollect'
                        }
                        else {
                            alert('删除失败');
                        }
                    }
                })
            }
    }
</script>
